package com.example.mock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: snow_grains
 * @Date: 2022/1/14
 * @Description:
 **/
@Component
public class UserService {

    @Autowired
    private UserDao userDao;

    public String saveUser(String name) {
        System.out.println("hahahahah");
        String s = userDao.saveUser(new User());
        System.out.println("userDao.saveUser()=" + s);
        return s;
    }

    public String testMock() {
        return "mock mock!";
    }

    public String userStaticMethod() {
        String name = UserUtil.getName();
        System.out.println("name=" + name);
        return name;
    }

    public String userPrivateMethod(String name) {
        return privateMethod(name);
    }

    private String privateMethod(String name) {
        return name;
    }
}
